drm2: wire up PRIME (DRI3) + render node#2220
Open
b1nc0d3x wants to merge 1 commit into
Open
Conversation
PRIME ioctls, drm_minor *render, and the matching helpers were
stubbed under FREEBSD_NOTYET since the 2012 import. Unguard
them and add the missing pieces:
- sys/dev/drm2/drm_prime.c: handle_to_fd / fd_to_handle on
top of FreeBSD's struct file (falloc_caps + custom fileops),
not Linux dma-buf. Single-driver PRIME — exported fds only
work in other drm2 driver opens, which is what X.org DRI3
needs.
- drmP.h: unguard PRIME helper externs, add
struct drm_minor *render, define DRIVER_RENDER 0x8000.
- drm_drv.c: unguard PRIME ioctl table entries.
- drm_ioctl.c: DRM_CAP_PRIME reports IMPORT|EXPORT.
- drm_platform.c: register render minor when DRIVER_RENDER set.
- sys/conf/files: build drm_prime.c.
No functional change for in-base drm2 drivers — none advertise
DRIVER_PRIME or DRIVER_RENDER, so the new paths are dormant.
A loadable drm2 driver that opts in now gets /dev/dri/renderD<n>
and X.org's DRI3 extension initialises against it.
Signed-off-by: Kyle Crenshaw <B1nc0d3x@gmail.com>
|
Thank you for taking the time to contribute to FreeBSD! Some of files have special handling: Important @bsdimp wants to review changes to sys/dev/drm2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
struct drm_minor *render, and the matching helpers were stubbed under#ifdef FREEBSD_NOTYETsince the 2012 import. Unguard them and add the missing implementation.sys/dev/drm2/drm_prime.cimplements handle_to_fd / fd_to_handle on FreeBSD's struct file (falloc_caps+ custom fileops), not Linux dma-buf. Single-driver PRIME — exported fds are only meaningful to other drm2 drivers, which is what X.org modesetting + DRI3 actually need.DRIVER_RENDER(new flag,0x8000) get/dev/dri/renderD<n>.DRIVER_PRIMEorDRIVER_RENDER, so the new paths are dormant for them.Test plan
make buildkernel TARGET=arm64 KERNCONF=GENERIC(drm2 statically linked) — clean.DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDERnow exposes/dev/dri/{card0,controlD64,renderD128}and Xorg logs(II) Initializing extension DRI3.drmModeDirtyFB+ PRIME ioctls round-trip cleanly; SLiM andstartxfce4render through the modesetting driver against the new render node.